All Functions of Week 1

library

{base}

Load an R package

mean

{base}

Get mean of a vector

rbind

{base}

Combine R objects by rows

read.spss

{foreign}

Read a .sav file (SPSS data)

table

{base}

Obtain frequency table of a variable/cross-tabulation of two variables

dim

{base}

Get dimensions of a data frame

ls

{base}

Return a vector of character strings giving the names of the objects in the specified environment

head

{utils}

Show first 5 rows of a data frame

names

{base}

Retrieve names of a list/vector

c

{base}

Combine values/vectors into a vector

plot

{graphics}

Generic function from base R to produce a plot

class

{base}

Retrieve class of an R object

setwd

{base}

Set Working Directory

str

{utils}

Get the structure of an R object

ncol

{base}

Get number of columns of a data frame

attach

{base}

Attach Set of R Objects to Search Path

ifelse

{base}

Return a or b depending on the value of test

cbind

{base}

Combine R objects by columns

sd

{stats}

Get standard deviation of a vector

View

{base}

View a data frame

nrow

{base}

Get number of rows of a data frame

ls.str

{utils}

Similarly to ls, with a print() method that calls str() on each object

The end!